import http from '@/utils/request'

// 查询角色列表
export const roleListPage = (data) => http.postJson('/role/listPage', data)

// 新增角色
export const roleSave = (data) => http.postJson('/role/save', data)

// 修改角色
export const roleUpdate = (data) => http.putJson('/role/update', data)

// 根据id删除角色
export const roleDeleteId = (id) => http.delete(`/role/delete/${id}`)

// 批量删除角色
export const roleDeleteBatch = (ids) => http.deleteJson(`/role/deleteBatch`, ids)

// 获取角色信息
export const roleGetId = (id) => http.get(`/role/get/${id}`)

// 根据角色id查询权限信息
export const rolePermissionIds = (id) => http.get(`/role/permissionIds/${id}`)

// 添加权限
export const roleUpdatePermissionsFromRole = (data) => http.putJson('/role/updatePermissionsFromRole', data)
